package cn.dengta.webapp.trade.model;

import cn.dengta.common.model.ValueProxy;
import cn.dengta.common.model.ValueProxyImpl;
import lombok.Getter;

/**
 * 内购商品 优惠枚举
 */
@Getter
public enum RechargeDiscount implements ValueProxyImpl<RechargeDiscount, Integer> {

	NONE(0, "无"),
	VIP(1, "VIP"),
	COMMON(2, "普通"),
	FIRST(3, "首充"),
	;

	RechargeDiscount(Integer value, String label) {
		this.value = value;
		this.proxy = new ValueProxy<>(this, value, label);
	}

	final ValueProxy<RechargeDiscount, Integer> proxy;

	public final Integer value;

	public static RechargeDiscount[] getValues() {
		return ValueProxy.getCachedArray(RechargeDiscount.class, RechargeDiscount::values);
	}

	public static RechargeDiscount of(Integer value) {
		if (value == null) {
			return NONE;
		}
		return NONE.getValueOf(value);
	}

}
